import {createRouter,createWebHistory} from "vue-router";

const routes=[
  {
    path: '/',
    redirect: '/business/list'
  },
  {
    path:'/business/list',
    component:()=>import('@/views/business/list')
  },
  {
    path: '/business/detail',
    component:()=>import('@/views/business/detail/index'),
    redirect:'/business/detail/foods',
    children:[
      {
        path:'foods',
        component:()=>import('@/views/business/detail/foods')
      },
      {
        path: 'info',
        component:()=>import('@/views/business/detail/info')
      }
    ]
  },
  {
    path: '/cart/list',
    component:()=>import('@/views/cart/list')
  },
  {
    path: '/user/my',
    component:()=>import('@/views/user/my')
  },
  {
    path: '/user/login',
    component:()=>import('@/views/user/login')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
